1. Field of the Invention
The present invention relates to an image processing apparatus, an image compression apparatus, an image processing method, an image compression method, a program, and a recording medium.
2. Description of the Related Art
In recent years and continuing, there is considerable spread in the use of images with high fineness. This is largely due to input devices (e.g., digital still cameras, scanners) and output devices (e.g., inkjet printers, displays) serving to handle very fine images. Among algorithms handling still images of high fineness, JPEG (Joint Photographic Experts Group) is, at present, most widely used. In eliminating the redundancy of spatial areas, JPEG employs a two-dimensional discrete cosine transform.
A basic function of this transform type is merely to compress and decompress still images. The JPEG type is neither able to manipulate images in a compressed state or view a particular area during decompression. In addition, the JPEG type handles an image as a flat structure that has no hierarchy. Accordingly, encoded data must be completely decoded in order to perform a new process on an image.
With the JPEG algorithm, as fineness of an image gets higher or the scale of an image gets larger, that is, as the number of pixels of an original image increases, the time required for decompressing the encoded image and displaying the image on a display device will also increase. Such an increase has reached a level that it can no longer be ignored since that fineness and area of an original have increased due to the improvements in the performance of recent input devices. It is also a concern for areas related to handling of satellite/aerial photographs or medical/scientific images, and areas related to recording images of cultural assets. It is to be noted that the time required in decompressing a JPEG compressed image has a characteristic of being a certain value having no relation to the compression ratio. This is due to the fact that JPEG compressed data must be completely decoded regardless of compression ratio.
Generally, displaying all pixels of a large image is difficult in that there is a restriction on the number of pixels that can be displayed on a display device. This is, therefore, actually dealt with by reducing the image on the display. Nevertheless, even in displaying a reduced image with a conventional JPEG algorithm, it is necessary to obtain every pixel value by decompressing the entire original image, and then conduct a pixel skipping process. The decompression time for obtaining every pixel value of the original image increases in proportion to the number of pixels of the image. Although the time may also depend on the performance of the CPU or the capacity of the memory, it takes, for example, several minutes to several tens of minutes until the image is displayed.
With the conventional JPEG algorithm, even in a case where sufficient information can be obtained without conducting a complete decoding process, such complete decoding process is necessary, and it is impossible to designate an image area targeted for decompression or an order (sequence) for performing decompression in a decompression process. The conventional JPEG algorithm has difficulty in meeting the needs such as displaying a color image with a gray scale image, viewing only a certain area of an image, viewing an image in a thumbnail size, accessing image contents at high speed, or viewing a fast forward display of a motion image. With the JPEG algorithm, first, image data are generated by performing a complete decompression process on encoded data of an original image. Then, a desired image is obtained by transforming the generated image data into, for example, image data for gray-scale display, image data for display of a particular area, or image data for thumbnail display.
Meanwhile, images are often displayed in thumbnail form by image display apparatuses. As for conventional techniques of displaying in thumbnail form, there are, for example, a method of decompressing an entire image and setting an appropriate resolution for the image, or a method of separately storing a thumbnail image. In any of such techniques, compression/decompression of an image is conducted by using basic functions of the JPEG standard or in some cases expanded functions. It is to be noted that a thumbnail image is an image that is output (e.g., displayed, printed, and/or transmitted) in a condensed form of a desired code size.
Nevertheless, a large amount of time is required for outputting (e.g. displaying, printing, and/or transmitting) a thumbnail image in a case of employing a thumbnail outputting method conducted by decompressing an entire image and setting a suitable resolution for the image.
In a case of employing a thumbnail outputting method conducted by separately storing a thumbnail image, data of a thumbnail image (small-sized image) itself are generally stored in a header portion of compressed data of a main image, as with, for example, Exif (Exchangeable image file format). Although this method is able to increase output speed, this method requires large storage capacity for compressed data.